<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>我是标题<span class="s"></span></h1>
<input type="text" id="i1">
<input type="text" id="i2">
<button onclick="f1()">按钮</button>
<script>
    let spanE = document.querySelector('.s');
    console.log(spanE);
    spanE.innerHTML = '我是span';
    let inputE1 = document.querySelector('#i1');
    console.log(inputE1);
    let inputE2 = document.getElementById('i2');
    console.log(inputE2);
    function f1() {
        var inputE1 = document.querySelector('#i1');
        console.log(inputE1);
        console.log(inputE1.value);
        var x = inputE1.value;
        console.log(x,typeof x);
        console.log(parseFloat(x));

    }
</script>
</body>
</html>